<html>
<body style="margin : 10px; padding : 0px;">

<div id="html" style="width : 600px; height : 400px; border : 1px solid black; background-color : white; opacity : 0.5">
</div>

<div id="flash" style="position : absolute; width : 600px; height : 400px; left : 10px; top : 10px; border : 1px solid red">
<object
  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
  width="600"
  height="400"
  id="flobj"
>
    <param name="movie" value="render.swf">
    <param name="bgcolor" value="000000">
    <param name="scale" value="noscale">
    <param name="salign" value="lt">
    <param name="menu" value="true">
    <param name="quality" value="high">
	<param name="wmode" value="transparent">
    <param name="allowScriptAccess" value="always">
    <embed
      src="render.swf"
      width="600"
      height="400"
      bgcolor="000000"
	  wmode="transparent"
      name="flobj"
      scale="noscale"
      salign="lt"
      menu="true"
      quality="high"
      swLiveConnect="true"
      allowScriptAccess="always"
      type="application/x-shockwave-flash"
      pluginspage="http://www.macromedia.com/go/getflashplayer"
    />
</object>
</div>

<div id="menu" style="position : absolute; top : 10px; right : 10px">
	<ul>
		<li><a href="#" onclick="return toggle('flash')">Flash ON/OFF</a></li>
		<li><a href="#" onclick="return toggle('html')">HTML ON/OFF</a></li>
		<li><a href="#" onclick="return init()">Reload HTML</a></li>
	</ul>
</div>

<script type="text/javascript">
	function init() {
		var x = new XMLHttpRequest();
		x.open("GET","test.html",false);
		x.send();
		var data = "<div"+x.responseText.split("<body")[1].split("</body>")[0]+"</div>";
		document.getElementById("html").innerHTML = data;
		return false;
	}
	function toggle(name) {
		var e = document.getElementById(name);
		var view = (e.style.display == "none") ? true : false;
		e.style.display = view ? "" : "none";
		document.cookie = name+"="+(view?1:0);
		return false;
	}
	init();
	if( document.cookie.indexOf("flash=0") >= 0 ) toggle("flash");
	if( document.cookie.indexOf("html=0") >= 0 ) toggle("html");
</script>

</body>
</html>
